//
//  TopicCell.m
//  A段项目,漫画
//
//  Created by dlios on 15-4-22.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "TopicCell.h"
#define WIDTH [[UIScreen mainScreen] bounds].size.width
#define HEIGHT self.contentView.frame.size.height
@implementation TopicCell
- (void)dealloc
{
    [_titleLabel release];
    [_ActionView release];
    [_timeLabel release];
    [_backView release];
    [super dealloc];
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.backView = [[UIView alloc]init];
        [self.contentView addSubview:self.backView];
        self.backView.layer.borderWidth =1;
        self.backView.layer.cornerRadius = 5;
        self.backView.layer.masksToBounds = YES;
        self.backView.backgroundColor = [UIColor whiteColor];
        [_backView release];
        
        self.titleLabel = [[UILabel alloc]init];
        [self.contentView addSubview:self.titleLabel];
        self.titleLabel.textColor = [UIColor whiteColor];
        [_titleLabel release];
        
        self.timeLabel = [[UILabel alloc]init];
        self.timeLabel.textColor = [UIColor whiteColor];
        [self.contentView addSubview:self.timeLabel];
        [_timeLabel release];
        
        self.ActionView = [[UIImageView alloc]init];
        self.ActionView.layer.borderWidth = 3;
        self.ActionView.layer.cornerRadius = 8;
        self.ActionView.layer.masksToBounds = YES;
        self.ActionView.backgroundColor = [UIColor whiteColor];
        [self.backView addSubview:self.ActionView];
        [_ActionView release];
        
        self.backImage = [[UIImageView alloc]init];
        [self.backView addSubview:self.backImage];
        self.backImage.backgroundColor = [UIColor grayColor];
        [_backImage release];
        
    }
    return self;
}

//布局设置
-(void)layoutSubviews
{
    [super layoutSubviews];
    
    self.backView.frame = CGRectMake(0, 0, WIDTH, HEIGHT );
    self.backView.layer.masksToBounds = YES;
    
    
    self.ActionView.frame = CGRectMake(10, 10, WIDTH - 20, HEIGHT - 20);
    self.ActionView.layer.masksToBounds = YES;
    self.ActionView.layer.borderColor = [UIColor clearColor].CGColor;
    
    self.titleLabel.frame = CGRectMake(10, 150, WIDTH - 150, 40);
    self.titleLabel.numberOfLines = 1;
    [self.titleLabel sizeToFit];
    self.titleLabel.font = [UIFont systemFontOfSize:20];
    
    self.timeLabel.frame = CGRectMake(200, 160, 120, 40);
    self.timeLabel.font = [UIFont systemFontOfSize:20];
    
    
    self.backImage.frame = CGRectMake(10, 150, WIDTH - 20, 40);
    self.backImage.layer.borderWidth = 3;
    self.backImage.layer.cornerRadius = 8;
    self.backImage.layer.masksToBounds =YES;
    self.backImage.alpha = 0.36;
    self.backImage.layer.borderColor = [UIColor clearColor].CGColor;
    
    
}- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
